package com.example.rabbitmqdemo.retry.controller;

import com.example.rabbitmqdemo.retry.service.RetryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
public class RetryController {

    @Autowired
    private RetryService retryService;

    @RequestMapping("/retry/{key}")
    public Object testRetry(@PathVariable("key") String key) {
        retryService.testRetry(key, LocalDateTime.now());
        return key + " " + LocalDateTime.now();
    }
}
